import { BaseIdInput } from "@/api-services/models/baseModels";
import { BaseApi } from "@/api-services/apis/baseApi";
import { SysFile } from "@/api-services/models/system/file";

/**
 * 文件服务
 */
class SysFileApi extends BaseApi {
  download = async (data: BaseIdInput) => {
    return this.normalGetBlob<Object>(`/download`, data);
  };
  downloadByPath = async (data: Object) => {
    return this.normalGetBlob<Object>(`/downloadByPath`, data);
  };
  upload = async (data: object) => {
    return this.normalPost<SysFile>(`/upload`, data);
  };
  batchUpload = async (data: Array<FormData>) => {
    return this.normalPost(`/batchUpload`, data);
  };
}

export default new SysFileApi("/system/file");
